package com.kaisu.blog.infrastructure.blog.dao;

import com.kaisu.blog.infrastructure.blog.BlogPO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Collection;

/**
 * @author kaisu
 */
@Repository
public interface BlogPODAO extends JpaRepository<BlogPO, String> {
    Page<BlogPO> findAll(Specification<BlogPO> specification, Pageable pageable);

    Page<BlogPO> findByCreateUserIdInAndStatus(Collection<String> userIds, String status, Pageable pageable);

    Page<BlogPO> findByCreateUserId(String userId, Pageable pageable);
}
